/**
 * Title:        Utility Class Library<p>
 * Description:  Some useful utility classes.<p>
 */
package com.timber.util;

import java.util.*;
import javax.swing.*;


class ImageDescriptor
{
  public int		id;
  public String		fileName;
  public ImageIcon	icon;

  public ImageDescriptor( int id, String fileName )
  {
    this.id = id;
    this.fileName = fileName;
    this.icon = null;
  }
}

public class ImageMgr
{
  public static final int	BASKETS_ICON		=  1;
  public static final int	BINOCULAR_ICON		=  2;
  public static final int	BLOTTER_ICON		=  3;
  public static final int	BORROW_ICON		=  4;
  public static final int	GO_ICON			=  5;
  public static final int	HOLD_ICON		=  6;
  public static final int	IMS_ABOUT_ICON		=  7;
  public static final int	IMS_LOGIN_ICON		=  8;
  public static final int	LOAN_ICON		=  9;

  public static final int	MINUS_ICON		= 10;
  public static final int	PLUS_ICON		= 11;
  public static final int	REALLOC_ICON		= 12;
  public static final int	RECALL_ICON		= 13;
  public static final int	REPORTS_ICON		= 14;
  public static final int	RETURN_ICON		= 15;
  public static final int	RUN_ICON		= 16;
  public static final int	SCALE_ICON		= 17;
  public static final int	DOWN_ARROW_ICON		= 18;
  public static final int	UP_ARROW_ICON		= 19;

  public static final int	FUNNEL_ICON		= 20;
  public static final int	PRINT_ICON		= 21;
  public static final int	CALCULATOR_ICON		= 22;
  public static final int	PRINT32_ICON		= 23;
  public static final int	ZOOMIN_ICON		= 24;
  public static final int	ZOOMOUT_ICON		= 25;
  public static final int	GO32_ICON		= 26;
  public static final int	CLEARALL_ICON		= 27;
  public static final int	CLEARALL32_ICON		= 28;
  public static final int	ZOOMIN24_ICON		= 29;

  public static final int	ZOOMOUT24_ICON		= 30;
  public static final int	COPY_ICON		= 31;
  public static final int	CUT_ICON		= 32;
  public static final int	PASTE_ICON		= 33;
  public static final int	EXPORT_ICON		= 34;
  public static final int	IMPORT_ICON		= 35;
  public static final int	APPLY_ICON		= 36;
  public static final int	OPEN24_ICON		= 37;
  public static final int	SAVE24_ICON		= 38;
  public static final int	UPDATEROW_ICON		= 39;

  public static final int	REPLY_ICON		= 40;
  public static final int	DBLOGO_ICON		= 41;
  public static final int	RADIO_RED_ICON		= 42;
  public static final int	RADIO_GRAY_ICON		= 43;
  public static final int	RADIO_PRESSED_ICON	= 44;
  public static final int	STOP_ICON		= 45;
  public static final int	SAVE_ICON		= 46;
  public static final int	OPEN_ICON		= 47;
  public static final int	LOG_ICON		= 48;
  public static final int	CONFIG_ICON		= 49;

  public static final int	CONTRACT_ICON		= 50;
  public static final int	PRMONITOR_ICON		= 51;
  public static final int	CHECK_ICON		= 52;
  public static final int	REFRESH_ICON		= 53;
  public static final int	RECALL32x24_ICON	= 54;
  public static final int	LOCATES_ICON		= 55;
  public static final int	PANDL_ICON		= 56;
  public static final int	THUMBUP_ICON		= 57;
  public static final int	RELOAD_ICON		= 58;
  public static final int	WARNING_ICON		= 59;

  public static final int	WAIT_ICON		= 60;
  public static final int	DELETE_ICON		= 61;
  public static final int	DELETE20X20_ICON	= 62;
  public static final int	DELETE24X24_ICON	= 63;
  public static final int	GAVEL_ICON		= 64;
  public static final int	EXIT_ICON		= 65;
  public static final int	PORTFOLIO_ICON		= 66;
  public static final int	ASCENDING_ICON		= 67;
  public static final int	DESCENDING_ICON		= 68;
  public static final int	ALLOCATE_ICON   	= 69;

  public static final int	ONLEND_ICON		= 70;
  public static final int	CALLHOLD_ICON	= 71;
  public static final int	CHECK2_ICON		= 72;
  public static final int	CANCEL_ICON		= 73;
  public static final int	ABACUS_ICON		= 74;
  public static final int	EXCEL_ICON		= 75;
  //public static final int	RET_ICON		= 76;
  public static final int   MANUAL_ICON     = 77;
  public static final int	PLUG_ICON		= 78;
  public static final int	UNPLUG_ICON		= 79;

  public static final int	GROUP_ICON		= 80;
  public static final int	IDELTA_ICON		= 81;
  public static final int	SHORTS_ICON		= 82;

  public static final int	ERROR_SPIKE_ICON	= 83;
  public static final int	LINK_ICON           = 84;
  public static final int	DROPLINK_ICON       = 85;
  public static final int	CLOSE_ICON          = 86;
  public static final int   GRAPH_ICON_7575     = 87;
  public static final int   GRAPH_ICON_2020     = 88;
  public static final int   TRAFFIC_LIGHT_RED 	= 89;
  
  public static final int TRAFFIC_LIGHT_AMBER 	= 90;
  public static final int TRAFFIC_LIGHT_GREEN 	= 91;

  public static final int 	DOLLAR 		        = 92;
  public static final int   RADIO_BLUE_ICON     = 93;
  public static final int   RADIO_GREEN_ICON    = 94;
  public static final int   RADIO_AMBER_ICON    = 95;
  public static final int   RADIO_ORANGE_ICON   = 96;
  public static final int   RADIO_YELLOW_ICON   = 97;
  public static final int   RADIO_PINK_ICON     = 98;
  public static final int   RADIO_PRESSED_RED_ICON = 99;
  public static final int   EMAIL_SENT     		= 100;
  public static final int	BILL_ICON		= 101;



  private static Hashtable	imageCache;



  public static void put( int id, String fileName )
  {
    imageCache.put( new Integer( id ),
		    new ImageDescriptor( id, fileName ) );
  }

  public static ImageIcon getIcon( int id )
  {
    ImageDescriptor idesc = ( ImageDescriptor )imageCache.get( new Integer( id ) );
    if( idesc == null )
      return null;

    try
    {
      if( idesc.icon == null )
	idesc.icon = new ImageIcon( ImageMgr.class.getResource( idesc.fileName ) );
    }
    catch( Exception ex )
    {
      System.out.println( "ImageMgr[" + idesc.fileName + "]:ERROR:" + ex.getMessage() );
      return null;
    }

    return idesc.icon;
  }

  static
  {
    imageCache = new Hashtable();

//     put( BASKETS_ICON,        "images/baskets_icon.gif" );
    put( BASKETS_ICON,          "images/baskets_icon32x25.gif" );
    put( BINOCULAR_ICON,        "images/Binocular.gif" );
    put( BLOTTER_ICON,          "images/blotter.gif" );
//     put( BORROW_ICON,         "images/borrow_icon.gif" );
    put( BORROW_ICON,           "images/borrow_icon32x25.gif" );
    put( GO_ICON,               "images/GO.gif" );
//     put( HOLD_ICON,           "images/hold_icon.gif" );
    put( HOLD_ICON,             "images/hold_icon32x24.gif" );
    put( IMS_ABOUT_ICON,        "images/ims_about.gif" );
    put( IMS_LOGIN_ICON,        "images/ims_login.gif" );
//     put( LOAN_ICON,           "images/loan_icon.gif" );
    put( LOAN_ICON,             "images/loan_icon32x25.gif" );
    put( MINUS_ICON,            "images/Minus.gif" );
    put( PLUS_ICON,             "images/Plus.gif" );
//     put( REALLOC_ICON,        "images/realloc_icon.gif" );
    put( REALLOC_ICON,          "images/realloc_icon32x25.gif" );
//     put( RECALL_ICON,         "images/recall_icon.gif" );
    put( RECALL_ICON,           "images/recall_icon_32x24.gif" );
    put( REPORTS_ICON,          "images/reports.gif" );
//     put( RETURN_ICON,         "images/return_icon.gif" );
    put( RETURN_ICON,           "images/return_icon32x24.gif" );
    put( RUN_ICON,              "images/run.gif" );
    put( STOP_ICON,             "images/stop.gif" );
//     put( SCALE_ICON,          "images/scale.gif" );
    put( SCALE_ICON,            "images/scale32x24.gif" );
    put( DOWN_ARROW_ICON,       "images/DownArrow.gif" );
    put( UP_ARROW_ICON,         "images/UpArrow.gif" );
    put( FUNNEL_ICON,           "images/funnel_icon.gif" );
    put( PRINT_ICON,            "images/Print.gif" );
    put( CALCULATOR_ICON,       "images/calculator_icon.gif" );
    put( PRINT32_ICON,          "images/print32.gif" );
    put( ZOOMIN_ICON,           "images/zoomin.gif" );
    put( ZOOMOUT_ICON,          "images/zoomout.gif" );
    put( GO32_ICON,             "images/GO32.gif" );
    put( CLEARALL_ICON,         "images/delete24.gif" );
    put( CLEARALL32_ICON,       "images/delete24.gif" );
    put( ZOOMIN24_ICON,         "images/zoomin24.gif" );
    put( ZOOMOUT24_ICON,        "images/zoomout24.gif" );
    put( COPY_ICON,             "images/Copy.gif" );
    put( CUT_ICON,              "images/Cut.gif" );
    put( PASTE_ICON,            "images/Paste.gif" );
    put( EXPORT_ICON,           "images/export24.gif" );
    put( IMPORT_ICON,           "images/import24.gif" );
    put( APPLY_ICON,            "images/Apply.gif" );
    put( OPEN24_ICON,           "images/open24.gif" );
    put( OPEN_ICON,             "images/Open.gif" );
    put( SAVE24_ICON,           "images/save24.gif" );
    put( SAVE_ICON,             "images/Save.gif" );
    put( UPDATEROW_ICON,        "images/UpdateRow.gif" );
    put( REPLY_ICON,            "images/Reply.gif" );
    put( DBLOGO_ICON,           "images/dblogo.gif" );
    put( RADIO_RED_ICON,        "images/radio_red.gif" );
    put( RADIO_GRAY_ICON,       "images/radio_gray.gif" );
    put( RADIO_PRESSED_ICON,    "images/radio_pressed.gif" );
    put( LOG_ICON,              "images/Draw.gif" );
    put( CONFIG_ICON,           "images/Hammer.gif" );
    put( CONTRACT_ICON,         "images/DocumentDraw.gif" );
    put( PRMONITOR_ICON,        "images/TrafficGreen.gif" );
    put( CHECK_ICON,            "images/Check.gif" );
    put( REFRESH_ICON,          "images/OpenArrow.gif" );
    put( RECALL32x24_ICON,      "images/recall_icon_32x24.gif" );
    put( LOCATES_ICON,          "images/locates.gif" );
    put( PANDL_ICON,            "images/pandl_icon.gif" );
    put( THUMBUP_ICON,          "images/ThumbUp.gif" );
    put( RELOAD_ICON,           "images/reload.gif" );
    put( WARNING_ICON,          "images/Warning.gif" );
    put( WAIT_ICON,             "images/Wait.gif" );
    put( DELETE_ICON,	        "images/deleteX20.gif" );
    put( CLOSE_ICON,	        "images/delete2.gif" );
    //Same as DELETE_ICON
    //put( DELETE20X20_ICON,    "images/deleteX20.gif" );
    put( DELETE24X24_ICON,      "images/deleteX24.gif" );
    put( GAVEL_ICON,            "images/gavel.gif" );
    put( EXIT_ICON,             "images/exit.gif" );
    put( PORTFOLIO_ICON,        "images/portfolio.gif" );
    put( ASCENDING_ICON,        "images/ascending.gif" );
    put( DESCENDING_ICON,       "images/descending.gif" );
    put( ALLOCATE_ICON,         "images/up_and_away_arrow.gif" );
    put( ONLEND_ICON,           "images/loop.gif" );
    put( CALLHOLD_ICON,         "images/callhold.gif" );
    put( CHECK2_ICON,           "images/check2.gif" );
    put( CANCEL_ICON,           "images/cancel.gif" );
    put( ABACUS_ICON,           "images/abacus.gif" );
    put( EXCEL_ICON,            "images/excel.gif" );
    put( MANUAL_ICON,           "images/manual.gif" );
    //put( RET_ICON,          "images/return.gif" );
    put( PLUG_ICON,             "images/Plug.gif" );
    put( UNPLUG_ICON,           "images/UnPlug.gif" );
    put( GROUP_ICON,            "images/group-sigma-17x21.gif" );
    put( IDELTA_ICON,           "images/idelta.gif" );
    put( SHORTS_ICON,           "images/shorts.gif" );
    put( ERROR_SPIKE_ICON,      "images/error.gif"  );
    put( LINK_ICON,             "images/link.gif");
    put( DROPLINK_ICON,         "images/droplink.gif");
    put( GRAPH_ICON_7575,       "images/icon_graph7575.gif");
    put( GRAPH_ICON_2020,       "images/icon_graph2020.gif");
    put( TRAFFIC_LIGHT_RED,     "images/red.gif");
    put( TRAFFIC_LIGHT_AMBER,   "images/amber.gif");
    put( TRAFFIC_LIGHT_GREEN,   "images/green.gif");
    put( DOLLAR,                "images/greendollar.gif");
    put( RADIO_BLUE_ICON,       "images/radio_blue.gif" );
    put( RADIO_GREEN_ICON,      "images/radio_green.gif" );
    put( RADIO_AMBER_ICON,      "images/radio_amber.gif" );
    put( RADIO_ORANGE_ICON,     "images/radio_orange.gif" );
    put( RADIO_YELLOW_ICON,     "images/radio_yellow.gif" );
    put( RADIO_PINK_ICON,       "images/radio_pink.gif" );
    put( RADIO_PRESSED_RED_ICON,"images/radio_pressed_red.gif" );
    put( EMAIL_SENT, 			"images/email_Send.png" );
    put( BILL_ICON,"images/Billing.jpg" );
  }
}
